home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
love4th.zip
/
MEMGRAPH.DOC
< prev
next >
Wrap
Text File
|
1991-10-01
|
8KB
|
180 lines
L.O.V.E. FORTH Interactive System Map
relative address description actual segment
0000:0000 ┌───────────┐ DOS PSP GET:PSP or GET:CS
0000:0100 ├───────────┤
│ │ CODE SEGMENT
├─ CS:HERE ─┤
│ │
│ │
│ │
│ │
│ virtual │
1000:0000 ╞═══════════╡
│ │ THREAD SEGMENT GET:TS
│ │
├─ TS:HERE ─┤
│ │
│ │
│ │
│ │
│ ^virtual^ │
2000:0000 ╞═══════════╡ DATA (VARIABLES) GET:VS
│ │ SEGMENT
├── HERE ───┤
HERE+54h├── PAD ───┤
│ │
│ │
│ ^virtual^ │
├─ FIRST ───┤
│ LIMIT │ block buffers
3000:0000 ╞═══════════╡
│ │ HEAD SEGMENT GET:HS
│ │
│ │
├─ HS:HERE ─┤
│ │
│ │
│ │
│ ^virtual^ │
4000:0000 ╞═══════════╡
├─ SS:HERE ─┤ STACK SEGMENT GET:SS
│ │
│ │
│ │
│ │
4000:DFF0 ├───────────┤ ^vocabulary stack (initial addresses
4000:EFF0 ├─ RPBOT ───┤ ^return stack given)
4000:FFF0 ├─ SPBOT ───┤ ^parameter stack
5000:0000 ╞═══════════╡
│ │ HEAP SEGMENT GET:HEAP
│ │
/ /
│ │ at least MINHEAP
└───────────┘ paragraphs
Notes: * GET:CS and GET:PSP return the same segment on version 1.28
and prior versions
* ^virtual^ vocabularies are at the top of memory, if present
* stacks work downward from high memory
L.O.V.E. FORTH APPLICATION Map
relative address description actual segment
0000:0000 ┌───────────┐ DOS PSP GET:PSP GET:CS
0000:0100 ├───────────┤
│ │ CODE SEGMENT
├─ CS:HERE ─┤
????:0000 ╞═══════════╡
│ │ THREAD SEGMENT GET:TS
│ │
├─ TS:HERE ─┤
????:0000 ╞═══════════╡ DATA (VARIABLES) GET:VS
│ │ SEGMENT
├── HERE ───┤
HERE+54h├── PAD ───┤
PAD+50h├─ FIRST ───┤
│ LIMIT │ block buffers
????:0000 ╞═══════════╡
├─ SS:HERE ─┤ STACK SEGMENT GET:SS
????:SS:HERE ├───────────┤
????: " +1000h├─ RPBOT ───┤ ^return stack
????: " +2000h├─ SPBOT ───┤ ^parameter stack
????:0000 ╞═══════════╡
│ │ HEAP SEGMENT GET:HEAP
│ │
/ /
│ │ at least MINHEAP
└───────────┘ paragraphs
Notes: * segments are packed to the nearest paragraph above their
respective xx:HERE
* GET:HS and HS:HERE are undefined
* vocabulary stack does not exist
* return and parameter stacks are allocated above SS:HERE
Segmentation Examples
Notes: * all addresses are 16 bits (cell)
* head segment can be eliminated from applications
* head segment form is subject to change in future versions
CODE Word Example
┌────/─┬─────────────────────────┬───────────────────────/──┐
CS: │ │ ..code .. code .. [next]│ │
└────/─┴─────────────────────────┴───────────────────────/──┘
^address xxxx
┌────/─┬────┬────────────────────────────────────────────/──┐
TS: │ │xxxx│ │
└────/─┴────┴────────────────────────────────────────────/──┘
^ compilation address yy
(cell points to code)
(VS: not relavent)
┌────/─╥────┬─────────┬──┬────┬──╥───────────────────────/──┐
HS: │ ║link│cnt name │yy│xxxx│ ║ │
└────/─╨────┴─────────┴──┴────┴──╨───────────────────────/──┘
^ ^pointers to code, compilation addr, etc
^name field address
COLON Word Example
┌────/─┬─────────────────────────────┬───────────────────/──┐
CS: │ │ colon nesting code .. [next]│ │
└────/─┴─────────────────────────────┴───────────────────/──┘
^address *col*
Nesting code is common to all colon words.
┌─╥──╥───╥─╥─/───╥─────┬────┬────┬────╥──────────────────/──┐
TS: │ ║ ║ ║ ║ ║*col*│ zz │ pp │EXIT║ │
└─╨──╨───╨─╨─/───╨─────┴────┴────┴────╨──────────────────/──┘
^pp ^zz ^compilation address qq
(points to code)
pp, zz compilation addresses of other words (cell)
EXIT compilation address of EXIT
(VS: not relavent)
┌────/─╥────┬─────────┬──┬───┬──╥────────────────────────/──┐
HS: │ ║link│cnt name │qq│ │ ║ │
└────/─╨────┴─────────┴──┴───┴──╨────────────────────────/──┘
^ ^pointers to code, compilation addr, etc
^name field address
VARIABLE Example
Note: A VARIABLE or CREATEd word is really just a CONSTANT that
returns an address
┌────/─┬───────────────────────┬─────────────────────────/──┐
CS: │ │ constant code.. [next]│ │
└────/─┴───────────────────────┴─────────────────────────/──┘
^address *con*
Constant code is common to all CONSTANTs,
VARIABLEs and CREATEd words
┌───────/───╥─────┬────╥─────────────────────────────────/──┐
TS: │ ║*con*│aaaa║ │
└───────/───╨─────┴────╨─────────────────────────────────/──┘
^ ^thread segment parameter field
^ aaaa = CONSTANT data or VARIABLE address
^compilation address vv
(points to code)
┌───────/───────╥────────────────────────────╥───────────/──┐
VS: │ ║ ... ALLOTed data space .. ║ │
└───────/───────╨────────────────────────────╨───────────/──┘
aaaa
┌────/─╥────┬─────────┬──┬──┬────╥────────────────────────/──┐
HS: │ ║link│cnt name │vv│ │aaaa║ │
└────/─╨────┴─────────┴──┴──┴────╨────────────────────────/──┘
^ ^pointers to code, compilation addr, etc
^name field address